package com.example.harmonys_api.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.harmonys_api.entity.Result;
import com.example.harmonys_api.entity.Type;
import com.example.harmonys_api.entity.User;
import com.example.harmonys_api.mapper.TypeMapper;
import com.example.harmonys_api.mapper.UserMapper;
import com.example.harmonys_api.service.ITypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 2251300221陈成权
 * @since 2025-09-30
 */
@Service
public class TypeServiceImpl extends ServiceImpl<TypeMapper, Type> implements ITypeService {
    @Resource
    TypeMapper typeMapper;
    public Result getAllType(){
        System.out.println("进入TypeServiceImpl+++getAllType（）");
        QueryWrapper<Type> qw = new QueryWrapper<>();
        List<Type> types =typeMapper.selectList(qw);
        Result<Type>typeResult=new Result<>();
        typeResult.setCode(200);
        typeResult.setMsg("查询成功");
        typeResult.setDatas(types);
        System.out.println("===="+typeResult.toString());


        return typeResult;
    }
    }

